#include <iostream>
#include <vector>
#include <unordered_set>

using namespace std;

class Solution {
public:
    vector<string> findRepeatedDnaSequences(string s) {
        unordered_set<string> exist_map;
        unordered_set<string> multi_map;
        for (int i = 0, length = s.size() - 10; i <= length; i++) {
            string sub_str = s.substr(i, 10);
            if (exist_map.count(sub_str) == 0) {
                exist_map.insert(sub_str);
            } else {
                multi_map.insert(sub_str);
            }
        }
        vector<string> result(multi_map.begin(), multi_map.end());
        return result;
    }
};

int main() {
    Solution solution;
    vector<string> output = solution.findRepeatedDnaSequences("AAAAAAAAAA");
    for (int i = 0; i < output.size(); i++) {
        cout << output[i] << endl;
    }
    return 0;
}
